//
//  GSTexture.h
//  GSEngine
//
//  Created by Александр on 02.02.14.
//  Copyright (c) 2014 SNK. All rights reserved.
//

#ifndef __GSEngine__GSTexture__
#define __GSEngine__GSTexture__

#include <iostream>
#include "GSResource.h"
#include <GSEngine/Math/GSMath.h>

namespace GSEngine
{
    enum ETextureType
    {
        ETexture2d   = 0,
        ETexture3d   = 1,
        ETextureCube = 2
    };
    enum ETextureFormat
    {
        ETextureBMP = 0,
        ETexturePNG = 1,
        ETextureJPG = 2
    };
    
    class GSTexture : public GSResource
    {
    private:
        // data
        ETextureType m_textureType;
        ETextureFormat m_textureFormat;
        vec2i m_size;
        int m_bitPerPixel;
        unsigned char* m_info;
        unsigned char* m_data;
        bool m_isLoaded;
        
    public:
        // methods
        GSTexture();
        GSTexture(ETextureFormat format);
        ~GSTexture();
        void loadTexture(const char* path, const char* permission);
        void loadFromBMP(const char* path, const char* permission);
        void loadFromPNG(const char* path, const char* permission);
        void loadFromJPG(const char* path, const char* permission);
        bool isLoadedTexture();
        
        ETextureType getTextureType();
        ETextureFormat getTextureFormat();
        vec2i getSize();
        int getBitPerPixel();
        unsigned char* getData();
    };
}

#endif /* defined(__GSEngine__GSTexture__) */
